package es.udc.emarketapp.emarket.test;


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.util.Iterator;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;

import es.udc.emarketapp.emarket.model.country.dao.SQLCountryDAO;
import es.udc.emarketapp.emarket.model.country.dao.SQLCountryDAOFactory;
import es.udc.emarketapp.emarket.model.country.vo.CountryVO;
import es.udc.emarketapp.emarket.model.countryFacade.CountryFacade;

import es.udc.fbellas.j2ee.util.sql.SimpleDataSource;




public final class PruebaCountryFacade {
		
    public static void main (String[] args) throws Exception {
	     	
	       
	    	   CountryFacade countryFacade = new CountryFacade();
	       
	
	       
	    	
	    	  //Prueba FindById de ProductountryDelegate   ++++++++++++++++++
	    	/*
	    	   CountryVO countryVO = countryFacade.findById("es");
	    	   
	    	   System.out.println(countryVO);
	    	*/   
	    	   
	    	
	    	   //Prueba FindAllCountries de  ProductCountryDelegate   +++++++++++++++++
	    	 
	    	   List<CountryVO> countryVOs;
	    	   
	    	   countryVOs = countryFacade.findAllCountries("es");
	    	   
	    	   Iterator<CountryVO> iter = countryVOs.iterator();
	    	   while (iter.hasNext()){
	    	     System.out.println(iter.next().getNomPais());
	    	   }
	    	   
	    	   
	           
	    } // main
} // class